package com.fanqwz.kotlinmvvm.ui.activity

import android.databinding.DataBindingComponent
import android.databinding.DataBindingUtil
import android.databinding.ViewDataBinding
import android.support.annotation.LayoutRes
import android.view.ViewGroup
import com.fanqwz.kotlinmvvm.databinding.AppDataBindingComponent

/**
 * Created by fanqwz on 2017/10/31.
 */

inline fun <T : ViewDataBinding> BaseActivity.bindContentView(@LayoutRes id: Int, component: AppDataBindingComponent): T? = DataBindingUtil.setContentView(this, id, component)

inline fun <T : ViewDataBinding> BaseActivity.createView(@LayoutRes id: Int, parent: ViewGroup?, component: DataBindingComponent): T? = DataBindingUtil.inflate(layoutInflater, id, parent, true, component)